<?php
	header("Content-Type: text/html;charset=utf-8");
	include("function/_nosql.php"); 
	include("function/function.php");

	$action = chkstr(trim($_REQUEST['action']));
	$custom_endarea = chkstr(trim($_REQUEST['custom_endarea']));
	$custom_zhuti = chkstr(trim($_REQUEST['custom_zhuti']));
	$custom_startime = chkstr(trim($_REQUEST['custom_startime']));
	$custom_activetime = chkstr(trim($_REQUEST['custom_activetime']));
	$custom_people = chkstr(trim($_REQUEST['custom_people']));
	$custom_power = chkstr(trim($_REQUEST['custom_power']));
	$custom_yusuan = chkstr(trim($_REQUEST['custom_yusuan']));
	$custom_text = chkstr(trim($_REQUEST['custom_text']));
	$custom_contact = chkstr(trim($_REQUEST['custom_contact']));
	$custom_phone = chkstr(trim($_REQUEST['custom_phone']));
	if($action == "save"){
		if(empty($custom_endarea)){
			echo erro("请将参数填写完整");
		}
		if(empty($custom_zhuti)){
			echo erro("请将参数填写完整");
		}
		if(empty($custom_startime)){
			echo erro("请将参数填写完整");
		}
		if(empty($custom_activetime)){
			echo erro("请将参数填写完整");
		}
		if(empty($custom_power)){
			echo erro("请将参数填写完整");
		}
		if(empty($custom_phone)){
			echo erro("请将参数填写完整");
		}
		// 添加数据
		$mysql = new sqlstr("kboy_custom"); 
		$mysql -> set("custom_endarea",$custom_endarea);
		$mysql -> set("custom_zhuti",$custom_zhuti);
		$mysql -> set("custom_startime",$custom_startime);
		$mysql -> set("custom_activetime",$custom_activetime);
		$mysql -> set("custom_people",$custom_people);
		$mysql -> set("custom_power",$custom_power);
		$mysql -> set("custom_yusuan",$custom_yusuan);
		$mysql -> set("custom_text",$custom_text);
		$mysql -> set("custom_contact",$custom_contact);
		$mysql -> set("custom_phone",$custom_phone);
		$news_sql = $mysql -> insertSql();
		$news_res = mysql_query($news_sql);
		if($news_res){
			echo ok("信息提交成功","index.php");
		}else{
			echo erro("服务器内部错误");
		}
	}else{
		echo erro("参数错误");
	}
	
?>